package davidtps.godutch.adapter;

import java.util.List;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import davidtps.godutch.activity.R;
import davidtps.godutch.adapter.base.AdapterBase;
import davidtps.godutch.business.BusinessAccount;
import davidtps.godutch.controls.SlideMenuViewItem;
import davidtps.godutch.model.ModelAccount;

public class AdapterResumeAccountDialog extends AdapterBase {
	private BusinessAccount mBusinessAccount;
	
	private class Holder{
		TextView tvResumeDialogAccountName;
	}
	
	public AdapterResumeAccountDialog(Context pContext) {
		super(pContext, null);
		mBusinessAccount = new BusinessAccount(pContext);
		List<ModelAccount> _ModelAccounts = mBusinessAccount.queryNoHideAccounts();
		setList(_ModelAccounts);
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		Holder _Holder;
		if(convertView==null){
			convertView = getLayoutInflater().inflate(R.layout.layout_roe_consume_dialog_listitem, null, true);
			
			_Holder = new Holder();
			_Holder.tvResumeDialogAccountName = (TextView)convertView.findViewById(R.id.tvResumeDialogAccountName);
			convertView.setTag(_Holder);
		}else{
			_Holder = (Holder)convertView.getTag();
		}
		
		ModelAccount _ModelAccount =  (ModelAccount) getList().get(position);
		_Holder.tvResumeDialogAccountName.setText(_ModelAccount.getAccountName());
		
		return convertView;
	}

}
